// Copyright (c) 2017-2025 Tencent. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package v20241204

import (
    tcerr "github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/errors"
    tchttp "github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/http"
    "github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/json"
)

type Alarm struct {
	// Alarm rule ID.
	Id *int64 `json:"Id,omitnil,omitempty" name:"Id"`

	// Alarm rule name.
	Name *string `json:"Name,omitnil,omitempty" name:"Name"`

	// Product ID
	ProductId *uint64 `json:"ProductId,omitnil,omitempty" name:"ProductId"`

	// Quota ID.
	QuotaId *uint64 `json:"QuotaId,omitnil,omitempty" name:"QuotaId"`

	// Alarm condition.
	Metrics *int64 `json:"Metrics,omitnil,omitempty" name:"Metrics"`

	// Alarm frequency.
	Frequency *int64 `json:"Frequency,omitnil,omitempty" name:"Frequency"`

	// Specifies the Alarm threshold. valid values: 0-100.
	Threshold *int64 `json:"Threshold,omitnil,omitempty" name:"Threshold"`

	// Creator UIN
	OwnerUin *int64 `json:"OwnerUin,omitnil,omitempty" name:"OwnerUin"`

	// Specifies the uin of the rule owner.
	MemberUin *int64 `json:"MemberUin,omitnil,omitempty" name:"MemberUin"`

	// Specifies the quota name.
	QuotaName *string `json:"QuotaName,omitnil,omitempty" name:"QuotaName"`

	// Product name
	ProductName *string `json:"ProductName,omitnil,omitempty" name:"ProductName"`

	// Whether to delete. 1: not deleted.
	// 2: delete.
	Status *uint64 `json:"Status,omitnil,omitempty" name:"Status"`
}

// Predefined struct for user
type CreateAlarmRequestParams struct {
	// Alarm rule name. specifies the name of the Alarm rule.
	Name *string `json:"Name,omitnil,omitempty" name:"Name"`

	// Product ID.
	ProductId *int64 `json:"ProductId,omitnil,omitempty" name:"ProductId"`

	// Quota ID.
	QuotaId *int64 `json:"QuotaId,omitnil,omitempty" name:"QuotaId"`

	// Alert metrics 1: quota usage 2: quota usage rate 3: remaining quota 4: remaining quota rate.
	Metrics *int64 `json:"Metrics,omitnil,omitempty" name:"Metrics"`

	// Specifies the Alarm threshold. value range: 0-100.
	Threshold *int64 `json:"Threshold,omitnil,omitempty" name:"Threshold"`

	// Alarm frequency.
	Frequency *int64 `json:"Frequency,omitnil,omitempty" name:"Frequency"`

	//   Member UIN.
	MemberUin *int64 `json:"MemberUin,omitnil,omitempty" name:"MemberUin"`
}

type CreateAlarmRequest struct {
	*tchttp.BaseRequest
	
	// Alarm rule name. specifies the name of the Alarm rule.
	Name *string `json:"Name,omitnil,omitempty" name:"Name"`

	// Product ID.
	ProductId *int64 `json:"ProductId,omitnil,omitempty" name:"ProductId"`

	// Quota ID.
	QuotaId *int64 `json:"QuotaId,omitnil,omitempty" name:"QuotaId"`

	// Alert metrics 1: quota usage 2: quota usage rate 3: remaining quota 4: remaining quota rate.
	Metrics *int64 `json:"Metrics,omitnil,omitempty" name:"Metrics"`

	// Specifies the Alarm threshold. value range: 0-100.
	Threshold *int64 `json:"Threshold,omitnil,omitempty" name:"Threshold"`

	// Alarm frequency.
	Frequency *int64 `json:"Frequency,omitnil,omitempty" name:"Frequency"`

	//   Member UIN.
	MemberUin *int64 `json:"MemberUin,omitnil,omitempty" name:"MemberUin"`
}

func (r *CreateAlarmRequest) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *CreateAlarmRequest) FromJsonString(s string) error {
	f := make(map[string]interface{})
	if err := json.Unmarshal([]byte(s), &f); err != nil {
		return err
	}
	delete(f, "Name")
	delete(f, "ProductId")
	delete(f, "QuotaId")
	delete(f, "Metrics")
	delete(f, "Threshold")
	delete(f, "Frequency")
	delete(f, "MemberUin")
	if len(f) > 0 {
		return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateAlarmRequest has unknown keys!", "")
	}
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type CreateAlarmResponseParams struct {
	// 1001
	AlarmId *int64 `json:"AlarmId,omitnil,omitempty" name:"AlarmId"`

	// The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

type CreateAlarmResponse struct {
	*tchttp.BaseResponse
	Response *CreateAlarmResponseParams `json:"Response"`
}

func (r *CreateAlarmResponse) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *CreateAlarmResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type DeleteAlarmRequestParams struct {
	// Rule ID
	Id *int64 `json:"Id,omitnil,omitempty" name:"Id"`

	// Specifies the member uin of the rule owner.
	MemberUin *int64 `json:"MemberUin,omitnil,omitempty" name:"MemberUin"`
}

type DeleteAlarmRequest struct {
	*tchttp.BaseRequest
	
	// Rule ID
	Id *int64 `json:"Id,omitnil,omitempty" name:"Id"`

	// Specifies the member uin of the rule owner.
	MemberUin *int64 `json:"MemberUin,omitnil,omitempty" name:"MemberUin"`
}

func (r *DeleteAlarmRequest) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DeleteAlarmRequest) FromJsonString(s string) error {
	f := make(map[string]interface{})
	if err := json.Unmarshal([]byte(s), &f); err != nil {
		return err
	}
	delete(f, "Id")
	delete(f, "MemberUin")
	if len(f) > 0 {
		return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteAlarmRequest has unknown keys!", "")
	}
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type DeleteAlarmResponseParams struct {
	// The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

type DeleteAlarmResponse struct {
	*tchttp.BaseResponse
	Response *DeleteAlarmResponseParams `json:"Response"`
}

func (r *DeleteAlarmResponse) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DeleteAlarmResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type DescribeAlarmsRequestParams struct {
	// Number of items per page. maximum 100.
	Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"`

	// Offset.
	Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"`

	// Product ID.
	ProductId *int64 `json:"ProductId,omitnil,omitempty" name:"ProductId"`

	// Quota ID.
	QuotaId *int64 `json:"QuotaId,omitnil,omitempty" name:"QuotaId"`

	// Alarm, quota name.
	Content *string `json:"Content,omitnil,omitempty" name:"Content"`

	// Member uins.
	MemberUins []*int64 `json:"MemberUins,omitnil,omitempty" name:"MemberUins"`

	// AlAlarm metric.
	Metrics *int64 `json:"Metrics,omitnil,omitempty" name:"Metrics"`

	// Rule ID
	Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"`
}

type DescribeAlarmsRequest struct {
	*tchttp.BaseRequest
	
	// Number of items per page. maximum 100.
	Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"`

	// Offset.
	Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"`

	// Product ID.
	ProductId *int64 `json:"ProductId,omitnil,omitempty" name:"ProductId"`

	// Quota ID.
	QuotaId *int64 `json:"QuotaId,omitnil,omitempty" name:"QuotaId"`

	// Alarm, quota name.
	Content *string `json:"Content,omitnil,omitempty" name:"Content"`

	// Member uins.
	MemberUins []*int64 `json:"MemberUins,omitnil,omitempty" name:"MemberUins"`

	// AlAlarm metric.
	Metrics *int64 `json:"Metrics,omitnil,omitempty" name:"Metrics"`

	// Rule ID
	Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"`
}

func (r *DescribeAlarmsRequest) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeAlarmsRequest) FromJsonString(s string) error {
	f := make(map[string]interface{})
	if err := json.Unmarshal([]byte(s), &f); err != nil {
		return err
	}
	delete(f, "Limit")
	delete(f, "Offset")
	delete(f, "ProductId")
	delete(f, "QuotaId")
	delete(f, "Content")
	delete(f, "MemberUins")
	delete(f, "Metrics")
	delete(f, "Id")
	if len(f) > 0 {
		return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAlarmsRequest has unknown keys!", "")
	}
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type DescribeAlarmsResponseParams struct {
	// Total number.
	Count *int64 `json:"Count,omitnil,omitempty" name:"Count"`

	// List of rules
	Data []*Alarm `json:"Data,omitnil,omitempty" name:"Data"`

	// The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

type DescribeAlarmsResponse struct {
	*tchttp.BaseResponse
	Response *DescribeAlarmsResponseParams `json:"Response"`
}

func (r *DescribeAlarmsResponse) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeAlarmsResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type EnableAlarmRequestParams struct {
	// Rule ID
	Id *int64 `json:"Id,omitnil,omitempty" name:"Id"`

	// Specifies the member uin of the rule owner.
	MemberUin *int64 `json:"MemberUin,omitnil,omitempty" name:"MemberUin"`
}

type EnableAlarmRequest struct {
	*tchttp.BaseRequest
	
	// Rule ID
	Id *int64 `json:"Id,omitnil,omitempty" name:"Id"`

	// Specifies the member uin of the rule owner.
	MemberUin *int64 `json:"MemberUin,omitnil,omitempty" name:"MemberUin"`
}

func (r *EnableAlarmRequest) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *EnableAlarmRequest) FromJsonString(s string) error {
	f := make(map[string]interface{})
	if err := json.Unmarshal([]byte(s), &f); err != nil {
		return err
	}
	delete(f, "Id")
	delete(f, "MemberUin")
	if len(f) > 0 {
		return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableAlarmRequest has unknown keys!", "")
	}
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type EnableAlarmResponseParams struct {
	// The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

type EnableAlarmResponse struct {
	*tchttp.BaseResponse
	Response *EnableAlarmResponseParams `json:"Response"`
}

func (r *EnableAlarmResponse) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *EnableAlarmResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type UpdateAlarmRequestParams struct {
	// ID
	Id *int64 `json:"Id,omitnil,omitempty" name:"Id"`

	// Alarm rule name.
	Name *string `json:"Name,omitnil,omitempty" name:"Name"`

	// Product ID.
	ProductId *int64 `json:"ProductId,omitnil,omitempty" name:"ProductId"`

	// Quota ID.
	QuotaId *int64 `json:"QuotaId,omitnil,omitempty" name:"QuotaId"`

	// 1: quota usage 2: quota usage rate 3: remaining quota 4: remaining quota rate.
	Metrics *int64 `json:"Metrics,omitnil,omitempty" name:"Metrics"`

	// Specifies the Alarm threshold. valid values: 0-100.
	Threshold *int64 `json:"Threshold,omitnil,omitempty" name:"Threshold"`

	// Alarm frequency.
	Frequency *int64 `json:"Frequency,omitnil,omitempty" name:"Frequency"`

	// Specifies the uin of the rule owner.
	// Operates non-group account rules. this parameter can be omitted.
	// Operates the organization account rule. specifies the uin of all users under the current rule.
	MemberUin *int64 `json:"MemberUin,omitnil,omitempty" name:"MemberUin"`
}

type UpdateAlarmRequest struct {
	*tchttp.BaseRequest
	
	// ID
	Id *int64 `json:"Id,omitnil,omitempty" name:"Id"`

	// Alarm rule name.
	Name *string `json:"Name,omitnil,omitempty" name:"Name"`

	// Product ID.
	ProductId *int64 `json:"ProductId,omitnil,omitempty" name:"ProductId"`

	// Quota ID.
	QuotaId *int64 `json:"QuotaId,omitnil,omitempty" name:"QuotaId"`

	// 1: quota usage 2: quota usage rate 3: remaining quota 4: remaining quota rate.
	Metrics *int64 `json:"Metrics,omitnil,omitempty" name:"Metrics"`

	// Specifies the Alarm threshold. valid values: 0-100.
	Threshold *int64 `json:"Threshold,omitnil,omitempty" name:"Threshold"`

	// Alarm frequency.
	Frequency *int64 `json:"Frequency,omitnil,omitempty" name:"Frequency"`

	// Specifies the uin of the rule owner.
	// Operates non-group account rules. this parameter can be omitted.
	// Operates the organization account rule. specifies the uin of all users under the current rule.
	MemberUin *int64 `json:"MemberUin,omitnil,omitempty" name:"MemberUin"`
}

func (r *UpdateAlarmRequest) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *UpdateAlarmRequest) FromJsonString(s string) error {
	f := make(map[string]interface{})
	if err := json.Unmarshal([]byte(s), &f); err != nil {
		return err
	}
	delete(f, "Id")
	delete(f, "Name")
	delete(f, "ProductId")
	delete(f, "QuotaId")
	delete(f, "Metrics")
	delete(f, "Threshold")
	delete(f, "Frequency")
	delete(f, "MemberUin")
	if len(f) > 0 {
		return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UpdateAlarmRequest has unknown keys!", "")
	}
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type UpdateAlarmResponseParams struct {
	// The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

type UpdateAlarmResponse struct {
	*tchttp.BaseResponse
	Response *UpdateAlarmResponseParams `json:"Response"`
}

func (r *UpdateAlarmResponse) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *UpdateAlarmResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}